-
-
Notifications
You must be signed in to change notification settings - Fork 978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Gesture Handler to TurboModule #2354
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments, other than them, LGTM 🚀
android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/swmansion/gesturehandler/RNGestureHandlerPackage.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt
Show resolved
Hide resolved
Ok, I've made some changes regarding the annotations - turns out that React Native 0.67 doesn't really like the fact that the annotations were in the parent class of the module, and those methods aren't visible from JS. On 0.73 (old arch) it wasn't a problem. Because of this, I've restored the annotations in the module and removed them from the spec file. This makes it work on both 0.73 and 0.67, so by induction it must also work on everything in between. The only possible problem with this is on the new arch the annotations are in two places - inside the spec generated by codegen and inside the module implementation itself. It seems to work for me on 0.73 new arch, but it may not work in the future though I guess it's a future us problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
…4933) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [react-native-gesture-handler](https://github.com/software-mansion/react-native-gesture-handler) | [`^2.14.1` -> `^2.15.0`](https://renovatebot.com/diffs/npm/react-native-gesture-handler/2.14.1/2.15.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/react-native-gesture-handler/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-native-gesture-handler/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-native-gesture-handler/2.14.1/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-native-gesture-handler/2.14.1/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>software-mansion/react-native-gesture-handler (react-native-gesture-handler)</summary> ### [`v2.15.0`](https://github.com/software-mansion/react-native-gesture-handler/releases/tag/2.15.0) [Compare Source](https://github.com/software-mansion/react-native-gesture-handler/compare/2.14.1...2.15.0) #### ❗ Important changes - macOS Support by [@​HeroBanana](https://github.com/HeroBanana) and [@​jfedak](https://github.com/jfedak) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2588](https://github.com/software-mansion/react-native-gesture-handler/pull/2588) - feat: add visionOS support by [@​tomekzaw](https://github.com/tomekzaw) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2743](https://github.com/software-mansion/react-native-gesture-handler/pull/2743) - Add `mouseButton` prop by [@​m-bert](https://github.com/m-bert) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2676](https://github.com/software-mansion/react-native-gesture-handler/pull/2676) - Migrate Gesture Handler to TurboModule by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2354](https://github.com/software-mansion/react-native-gesture-handler/pull/2354) #### 🐛 Bug fixes - Add checks for the same instance of handler usage across multiple `GestureDetectors` by [@​m-bert](https://github.com/m-bert) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2694](https://github.com/software-mansion/react-native-gesture-handler/pull/2694) - Remove `didMountComponentsWithRootTag` on the new arch by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2687](https://github.com/software-mansion/react-native-gesture-handler/pull/2687) - Fix double start when `activateAfterLongPress` is used by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2628](https://github.com/software-mansion/react-native-gesture-handler/pull/2628) - Reset relevant handler when recognizer gets reset. by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2705](https://github.com/software-mansion/react-native-gesture-handler/pull/2705) - Fix `inactive` handlers staying at finished state by [@​m-bert](https://github.com/m-bert) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2738](https://github.com/software-mansion/react-native-gesture-handler/pull/2738) - Change functions in windows module file to no-ops. by [@​m-bert](https://github.com/m-bert) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2741](https://github.com/software-mansion/react-native-gesture-handler/pull/2741) - Fix handlers coming back from being cancelled by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2704](https://github.com/software-mansion/react-native-gesture-handler/pull/2704) - fix: restore ReactMethod annotation by [@​WoLewicki](https://github.com/WoLewicki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2722](https://github.com/software-mansion/react-native-gesture-handler/pull/2722) #### 🔢 Miscellaneous - Bump react-devtools-core from 4.27.6 to 4.28.4 in /example by [@​dependabot](https://github.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2650](https://github.com/software-mansion/react-native-gesture-handler/pull/2650) - Add `workflow_dispatch` to workflows by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2295](https://github.com/software-mansion/react-native-gesture-handler/pull/2295) - Update supported versions in readme and in docs by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2684](https://github.com/software-mansion/react-native-gesture-handler/pull/2684) - Prevent GH actions trigger on forks, update template by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2696](https://github.com/software-mansion/react-native-gesture-handler/pull/2696) - Auto add `Platform: MacOS` label when `MacOS` is picked in the issue by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2699](https://github.com/software-mansion/react-native-gesture-handler/pull/2699) - Change eslint `ban-types` to warning. by [@​m-bert](https://github.com/m-bert) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2714](https://github.com/software-mansion/react-native-gesture-handler/pull/2714) - Fix macOS warning message by [@​jfedak](https://github.com/jfedak) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2713](https://github.com/software-mansion/react-native-gesture-handler/pull/2713) - Bump dependencies to stable React Native 0.73.2 by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2698](https://github.com/software-mansion/react-native-gesture-handler/pull/2698) - Add macOS app icon by [@​jfedak](https://github.com/jfedak) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2723](https://github.com/software-mansion/react-native-gesture-handler/pull/2723) - Bump follow-redirects from 1.15.3 to 1.15.4 in /e2e/web-tests by [@​dependabot](https://github.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2719](https://github.com/software-mansion/react-native-gesture-handler/pull/2719) #### New Contributors - [@​mrousavy](https://github.com/mrousavy) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2690](https://github.com/software-mansion/react-native-gesture-handler/pull/2690) - [@​HeroBanana](https://github.com/HeroBanana) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2588](https://github.com/software-mansion/react-native-gesture-handler/pull/2588) - [@​fxamauri](https://github.com/fxamauri) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2712](https://github.com/software-mansion/react-native-gesture-handler/pull/2712) - [@​jfedak](https://github.com/jfedak) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2713](https://github.com/software-mansion/react-native-gesture-handler/pull/2713) - [@​computerjazz](https://github.com/computerjazz) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2715](https://github.com/software-mansion/react-native-gesture-handler/pull/2715) **Full Changelog**: software-mansion/react-native-gesture-handler@2.14.0...2.15.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone America/Los_Angeles. 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/valora-inc/wallet). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNzMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE3My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: valora-bot <valorabot@valoraapp.com>
…alora-inc#4933) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [react-native-gesture-handler](https://github.com/software-mansion/react-native-gesture-handler) | [`^2.14.1` -> `^2.15.0`](https://renovatebot.com/diffs/npm/react-native-gesture-handler/2.14.1/2.15.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/react-native-gesture-handler/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-native-gesture-handler/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-native-gesture-handler/2.14.1/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-native-gesture-handler/2.14.1/2.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>software-mansion/react-native-gesture-handler (react-native-gesture-handler)</summary> ### [`v2.15.0`](https://github.com/software-mansion/react-native-gesture-handler/releases/tag/2.15.0) [Compare Source](https://github.com/software-mansion/react-native-gesture-handler/compare/2.14.1...2.15.0) #### ❗ Important changes - macOS Support by [@​HeroBanana](https://github.com/HeroBanana) and [@​jfedak](https://github.com/jfedak) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2588](https://github.com/software-mansion/react-native-gesture-handler/pull/2588) - feat: add visionOS support by [@​tomekzaw](https://github.com/tomekzaw) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2743](https://github.com/software-mansion/react-native-gesture-handler/pull/2743) - Add `mouseButton` prop by [@​m-bert](https://github.com/m-bert) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2676](https://github.com/software-mansion/react-native-gesture-handler/pull/2676) - Migrate Gesture Handler to TurboModule by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2354](https://github.com/software-mansion/react-native-gesture-handler/pull/2354) #### 🐛 Bug fixes - Add checks for the same instance of handler usage across multiple `GestureDetectors` by [@​m-bert](https://github.com/m-bert) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2694](https://github.com/software-mansion/react-native-gesture-handler/pull/2694) - Remove `didMountComponentsWithRootTag` on the new arch by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2687](https://github.com/software-mansion/react-native-gesture-handler/pull/2687) - Fix double start when `activateAfterLongPress` is used by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2628](https://github.com/software-mansion/react-native-gesture-handler/pull/2628) - Reset relevant handler when recognizer gets reset. by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2705](https://github.com/software-mansion/react-native-gesture-handler/pull/2705) - Fix `inactive` handlers staying at finished state by [@​m-bert](https://github.com/m-bert) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2738](https://github.com/software-mansion/react-native-gesture-handler/pull/2738) - Change functions in windows module file to no-ops. by [@​m-bert](https://github.com/m-bert) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2741](https://github.com/software-mansion/react-native-gesture-handler/pull/2741) - Fix handlers coming back from being cancelled by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2704](https://github.com/software-mansion/react-native-gesture-handler/pull/2704) - fix: restore ReactMethod annotation by [@​WoLewicki](https://github.com/WoLewicki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2722](https://github.com/software-mansion/react-native-gesture-handler/pull/2722) #### 🔢 Miscellaneous - Bump react-devtools-core from 4.27.6 to 4.28.4 in /example by [@​dependabot](https://github.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2650](https://github.com/software-mansion/react-native-gesture-handler/pull/2650) - Add `workflow_dispatch` to workflows by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2295](https://github.com/software-mansion/react-native-gesture-handler/pull/2295) - Update supported versions in readme and in docs by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2684](https://github.com/software-mansion/react-native-gesture-handler/pull/2684) - Prevent GH actions trigger on forks, update template by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2696](https://github.com/software-mansion/react-native-gesture-handler/pull/2696) - Auto add `Platform: MacOS` label when `MacOS` is picked in the issue by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2699](https://github.com/software-mansion/react-native-gesture-handler/pull/2699) - Change eslint `ban-types` to warning. by [@​m-bert](https://github.com/m-bert) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2714](https://github.com/software-mansion/react-native-gesture-handler/pull/2714) - Fix macOS warning message by [@​jfedak](https://github.com/jfedak) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2713](https://github.com/software-mansion/react-native-gesture-handler/pull/2713) - Bump dependencies to stable React Native 0.73.2 by [@​j-piasecki](https://github.com/j-piasecki) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2698](https://github.com/software-mansion/react-native-gesture-handler/pull/2698) - Add macOS app icon by [@​jfedak](https://github.com/jfedak) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2723](https://github.com/software-mansion/react-native-gesture-handler/pull/2723) - Bump follow-redirects from 1.15.3 to 1.15.4 in /e2e/web-tests by [@​dependabot](https://github.com/dependabot) in [https://github.com/software-mansion/react-native-gesture-handler/pull/2719](https://github.com/software-mansion/react-native-gesture-handler/pull/2719) #### New Contributors - [@​mrousavy](https://github.com/mrousavy) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2690](https://github.com/software-mansion/react-native-gesture-handler/pull/2690) - [@​HeroBanana](https://github.com/HeroBanana) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2588](https://github.com/software-mansion/react-native-gesture-handler/pull/2588) - [@​fxamauri](https://github.com/fxamauri) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2712](https://github.com/software-mansion/react-native-gesture-handler/pull/2712) - [@​jfedak](https://github.com/jfedak) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2713](https://github.com/software-mansion/react-native-gesture-handler/pull/2713) - [@​computerjazz](https://github.com/computerjazz) made their first contribution in [https://github.com/software-mansion/react-native-gesture-handler/pull/2715](https://github.com/software-mansion/react-native-gesture-handler/pull/2715) **Full Changelog**: software-mansion/react-native-gesture-handler@2.14.0...2.15.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone America/Los_Angeles. 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/valora-inc/wallet). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNzMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE3My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: valora-bot <valorabot@valoraapp.com>
Description
Make Gesture Handler a TurboModule instead of a Native Module 🚀
Test plan
Tested on the Example and FabricExample app. Needs to be tested on RN 0.67 - the lowes still supported by RNGH